﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class StringJoinDemo
    {

        private void StringUnitDemo()
        {
            //多个字符串需要连接，最好用string.format();
            string str = string.Format("Hello, {0}. Today is {1} ", "Alan", System.DateTime.Now.ToString());

            //复杂的字符串，可以使用StringBuilder类
            StringBuilder msg = new StringBuilder("Hello, ");
            msg.Append("Alan");
            msg.Append(". Today is ");
            msg.Append(DateTime.Now.ToString());

            string strMeg = msg.ToString();
        }
    }
}
